Lock a potentially multi-planar AHardwareBuffer for direct CPU access.
This function is similar to AHardwareBuffer_lock, but can lock multi-planar
formats. The locked planes are returned in the \a outPlanes argument. Note,
that multi-planar should not be confused with multi-layer images, which this
locking function does not support.
YUV formats are always represented by three separate planes of data, one for
each color plane. The order of planes in the array is guaranteed such that
plane #0 is always Y, plane #1 is always U (Cb), and plane #2 is always V
(Cr). All other formats are represented by a single plane.
Additional information always accompanies the buffers, describing the row
stride and the pixel stride for each plane.
In case the buffer cannot be locked, \a outPlanes will contain zero planes.
See the AHardwareBuffer_lock documentation for all other locking semantics.
\return 0 on success. -EINVAL if \a buffer is NUL, the usage flags
are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer
has more than one layer. Error number if the lock fails for any other
reason.
Lock a potentially multi-planar AHardwareBuffer for direct CPU access.
This function is similar to AHardwareBuffer_lock, but can lock multi-planar formats. The locked planes are returned in the \a outPlanes argument. Note, that multi-planar should not be confused with multi-layer images, which this locking function does not support.
YUV formats are always represented by three separate planes of data, one for each color plane. The order of planes in the array is guaranteed such that plane #0 is always Y, plane #1 is always U (Cb), and plane #2 is always V (Cr). All other formats are represented by a single plane.
Additional information always accompanies the buffers, describing the row stride and the pixel stride for each plane.
In case the buffer cannot be locked, \a outPlanes will contain zero planes.
See the AHardwareBuffer_lock documentation for all other locking semantics.
\return 0 on success. -EINVAL if \a buffer is NUL, the usage flags are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer has more than one layer. Error number if the lock fails for any other reason.